<template>
    <el-dropdown @command="handleCommand">
        <span class="el-dropdown-link">
            发布时间<i class="el-icon-caret-bottom el-icon--right" :style="{color: '#02a7fb'}"></i>
        </span>
        <el-dropdown-menu slot="dropdown">
            <el-dropdown-item command="asc">升序</el-dropdown-item>
            <el-dropdown-item command="desc">降序</el-dropdown-item>
        </el-dropdown-menu>
    </el-dropdown>
</template>

<script>
    import {Dropdown, DropdownMenu, DropdownItem} from 'element-ui';

    export default {
        components: {
            ElDropdown: Dropdown,
            ElDropdownMenu: DropdownMenu,
            ElDropdownItem: DropdownItem,
        },
        methods: {
            handleCommand(val) {
                this.$emit('command', val);
            }
        }
    };
</script>
